package com.itheima.homework5;

public class Producer implements Runnable {
    private StoreHouse house;

    public Producer(StoreHouse house) {
        this.house = house;
    }

    private static int num = 0;

    @Override
    public void run() {
        while (num < 100) {
            house.store();
            if (++num % 10 == 0) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

